<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="/js/validators/user.jsp"></s:include>
  <div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
    <div style="height:24px;color:red;font-weight:bold" align="left">用户更新</div>
    <s:form id="submitForm" action="user!updateEmployee" method="post" theme="simple">
    <table width="100%">
    	<tbody>
    		<tr>
    			<td><s:text name="姓名"/>：</td>
    			<td><input maxlength="25" type="text" name="user.userName" value="${user.userName}"></td>
    			<td><s:text name="电子邮箱"/>：</td>
    			<td><input maxlength="25" type="text" name="user.email"  value="${user.email}"></td>
    		</tr>
    		<tr>
    			<td><s:text name="密码"/>：</td>
    			<td><input maxlength="14" type="password" name="user.password" value="${user.password}"></td>
    			<td><s:text name="重复密码"/>：</td>
    			<td><input maxlength="14" type="password" name="user.repassword"  value="${user.password}"></td>
    		</tr>
    		<tr>
    			<td><s:text name="手机"/>：</td>
    			<td><input maxlength="13" type="text" name="user.mobile"  value="${user.mobile}"></td>
    			<td><s:text name="传真"/>：</td>
    			<td><input maxlength="25" type="text" name="user.fax"  value="${user.fax}"></td>
    		</tr>
    		<tr>
    			<td><s:text name="公司"/>：</td>
    			<td>${user.companyName}</td>
    			<td><s:text name="职位"/>：</td>
    			<td> 
    			  <select name="user.positionId" id="positions">
                	<s:iterator value="allPositions" status="status">
                    <option value="${id}" <s:if test="%{user.positionId == id}">selected="selected"</s:if>>${name}</option>
                  	</s:iterator>
            	  </select>
            	</td>
    		</tr>
    		<tr>
    			<td><s:text name="类型"/>：</td>
    			<td>
	    			<s:if test="user.type==0">管理员</s:if> 
	            	<s:if test="user.type==1">员工</s:if>
	            	<s:if test="user.type==2">试用用户</s:if>
	            	<s:if test="user.type==3">正式用户</s:if>
	            	<s:if test="user.type==4">用户代表</s:if>
	            </td>
    			<td>
    			 <s:text name="到期时间"/>：
    			</td>
    			<td> <input readonly="true" value='<s:date name="user.deadline" format="yyyy-MM-dd"/>' id="deadLine" style="width:80px" name="user.deadline" onclick="return showCalendar('deadLine', 'y-mm-dd');" /><span></span></td>
    		</tr>
    		<tr>
    			<td colspan="4">
    				<s:text name="国家"/>：<input maxlength="25" type="text" name="user.country"  value="${user.country}">
            		<s:text name="省"/>：<input maxlength="25" type="text" name="user.province"  value="${user.province}">
            		<s:text name="市"/>：<input maxlength="25" type="text" name="user.city"  value="${user.city}">
    			</td>
    		</tr>
    		<tr>
    			<td colspan="4">
    				 <s:text name="地址"/>：<input maxlength="50" type="text" name="user.address" style="width: 450px;" value="${user.address}">
    			</td>
    		</tr>
 			<tr>
 				<td colspan="2" align="right"><input type="submit" value="确认" onclick="return doValidate(event);" /></td>
 				<td colspan="2" align="left"><input type="button" value="取消" onclick="javascript:history.back(-1);"/></td>
 			</tr>   		
    	</tbody>
    
    </table>
        <input type="hidden" id="user.id" name="user.id" value="${user.id}">
        <input type="hidden" id="user.companyName" name="user.companyName" value="${user.companyName}">
        <input type="hidden" id="user.companyId" name="user.companyId" value="${user.companyId}">
        <input type="hidden" id="user.type" name="user.type" value="${user.type}">
    </s:form>
  </div>
